// 1997 Recoding

global keepers1997 ""

numlabel, add

genl id=serialno
global keepers1997 $keepers1997 id

genl year=1997
global keepers1997 $keepers1997 year

genl wt=wtallgb
global keepers1997 $keepers1997 wt

genl income=hhincoma
recode income -1=.
replace income=hhincomb if income==. & hhincomb~=.
recode income -1 95/99=.
genl income3=income
centile income, c(33 66 100)
replace income3=0 if income<=r(c_1)
centile income, c(33 66 100)
replace income3=1 if income>r(c_1) & income<=r(c_2)
centile income, c(33 66 100)
replace income3=2 if income>r(c_2) & income<=r(c_3)
global keepers1997 $keepers1997 income3

genl pid_ce=ptythnk
recode pid_ce 2/98=0
global keepers1997 $keepers1997 pid_ce

ren turnout turnout_
genl turnout=voted
recode turnout 2/9=0
global keepers1997 $keepers1997 turnout

genl vote_ce=vote
recode vote_ce -1=. 2/99=0
global keepers1997 $keepers1997 vote_ce


// Campaign Interest

codebook politics
gen intpolsnew = politics
recode intpolsnew 9=.
replace intpolsnew=(abs(intpolsnew-5))/4
label variable intpolsnew "interest in pols"
label define interest 1 "1=high interest"
label values intpolsnew interest
tab politics intpolsnew
global keepers1997 $keepers1997 intpolsnew

codebook artatpl
gen intpolsnewsnew = artatpl
recode intpolsnewsnew 8=3 9=. -1=.
replace intpolsnewsnew=(abs(intpolsnewsnew-5))/4
label variable intpolsnewsnew "interest in pols news"
label values intpolsnewsnew interest
tab artatpl intpolsnewsnew
global keepers1997 $keepers1997 intpolsnewsnew

gen ptymembnew = ptymemb
recode ptymembnew 1/5=1 0=0 97=. 98=.5 99=.
label variable ptymembnew "party membership new"
label define membr 1 "1=member"
label values ptymembnew membr
tab ptymembnew ptymemb
global keepers1997 $keepers1997 ptymemb

codebook carewon
gen intissuenew = carewon
recode intissuenew 1=1 2=0 9=. 8=.5
label variable intissuenew "cared about who won new"
label define care 1 "1=cared"
label values intissuenew care
tab carewon intissuenew
global keepers1997 $keepers1997 intissuenew


// Media Exposure

codebook readpap
gen npexpnew = readpap
recode npexpnew 1=1 2=0 9=.
label variable npexpnew "reads newspaper new"
label define reads 1 "1=reads np"
label values npexpnew reads
tab readpap npexpnew
global keepers1997 $keepers1997 npexpnew


// Ideology

codebook rtxspd
gen taxspendnew = rtxspd
recode taxspendnew 12=1 13=11 98=6 99=. -2=.
replace taxspendnew=(abs(taxspendnew-11))/10
label variable taxspendnew "social spending new"
label define spend 1 "1=pro-spending" 
label values taxspendnew spend
tab taxspendnew
tab rtxspd
global keepers1997 $keepers1997 taxspendnew

codebook tulaws
gen unionregnew = tulaws
recode unionregnew 8=3 9=.
replace unionreg=(abs(unionreg-5))/4
label variable unionregnew "gov't regulation of unions new"
label define reg 1 "1=increase regulation"
label values unionregnew reg
tab unionregnew tulaws
global keepers1997 $keepers1997 unionregnew

codebook natnl1
gen stateownnew = natnl1
recode stateownnew 1=1 2=0 3=.5 8=.5 9=. 4=.
label variable stateownnew "nationalisation new"
label define natnlown 1 "1=pro-nationalisation"
label values stateownnew natnlown
tab stateownnew natnl1
global keepers1997 $keepers1997 stateownnew

codebook ridpovty
gen povertyspendnew = ridpovty
recode povertyspendnew 8=3 9=.
replace povertyspendnew = (abs(povertyspendnew-5))/4
label variable povertyspendnew "gov't spending on poverty reduction"
label values povertyspendnew spend
tab ridpovty povertyspendnew
global keepers1997 $keepers1997 povertyspendnew

codebook redistrb
gen redistributenew = redistrb
recode redistributenew 8=3 9=.
replace redistributenew=(abs(redistributenew-5))/4
tab redistrb redistributenew
label variable redistributenew "gov't redistribution 1987 new"
label define red 1 "1=pro-redistribution new"
label values redistributenew red
tab redistrb redistributenew
global keepers1997 $keepers1997 redistributenew

gen buspowernew = buspower
recode buspowernew 1=1 2=0 8=.5 9=.
label variable buspowernew "business power new"
label define powers 1 "1=too much power"
label values buspowernew powers
tab buspowernew buspower
global keepers1997 $keepers1997 buspowernew



// Class/occupation

// Assuming that husband is "head of household"
*gen class_head_grade = 
*recode class_head_grade 0=.
label define LblClassGoldHeath 1 "High grade prof./man." 2 "Low grade prof./man." 3 "Routine office" 4 "Sales & personal" 5 "Small petty bourg. w emps" 6 "Small petty bourg. wo emps" 7 "Farmers" 8 "Manual foremen" 9 "Skilled manual" 10 "Semi & unskilled manual" 11 "Agric. employees"
*label values class_head_grade LblClassGrade
*global keepers1997 $keepers1997 class_head_grade

gen class_resp_goldheath = rghclass
recode class_resp_goldheath -2=. 99=.
label values class_resp_goldheath LblClassGoldHeath
global keepers1997 $keepers1997 class_resp_goldheath

gen class_spou_goldheath = sghclass
recode class_spou_goldheath -2=. -1=. 99=.
label values class_spou_goldheath LblClassGoldHeath
global keepers1997 $keepers1997 class_spou_goldheath

gen male = rsex
recode male 1=1 2=0 8=. 9=.
global keepers1997 $keepers1997 male

rename married married_
gen married = marstat2
recode married 1=1 2=1 3=0 4=0 5=0 6=0 8=0 9=0
global keepers1997 $keepers1997 married



gen unionmem_resp = unionsa2
recode unionmem_resp 1=1 2=1 3=0 8=. 9=.
global keepers1997 $keepers1997 unionmem_resp

gen unionmempast_resp = tusaever
recode unionmempast_resp -1=. 1=1 2=1 3=0 8=. 9=.
global keepers1997 $keepers1997 unionmempast_resp

gen unionmem_spou = suniosa2
recode unionmem_spou -1=. 1=1 2=0 3=0 8=. 9=.
global keepers1997 $keepers1997 unionmem_spou

gen unionmempast_spou = stusaevr
recode unionmempast_spou -2=. -1=. 1=1 2=1 3=0 8=. 9=.
global keepers1992 $keepers1992 unionmempast_spou





// Economic perceptions

gen econ_ego_retro = ghinpst
recode econ_ego_retro 1/2=2 3=1 4/5=0 8/9=.
global keepers1997 $keepers1997 econ_ego_retro
